<?php

class duxConsumoBrModel extends Model2
{
    public function __construct() {
        parent::__construct('progdeprodbr.materialvac');
    }
    
    public function materialVaciado($id){
        $this->setQuery("
            SELECT 
                progdeprodbr.lances.Idlance,
                progdeprodbr.lances.NumLance,
                progdeprodbr.hornos.Horno,
                progdeprodbr.lances.Consecutivo,
                progdeprodbr.lances.FECHA,
                progdeprodbr.lances.ALEACION,
                progdeprodbr.lances.OBS,
                progdeprodbr.materialvac.PRODUCTO,
                progdeprodbr.materialescat.Descrip,
                progdeprodbr.materialescat.CODIGO,
                progdeprodbr.materialvac.CANT
            FROM progdeprodbr.lances
            INNER JOIN progdeprodbr.materialvac ON materialvac.IDLANCE = lances.Idlance
            INNER JOIN progdeprodbr.materialescat ON materialvac.PRODUCTO = materialescat.IdMaterial
            INNER JOIN progdeprodbr.hornos ON lances.Horno = hornos.Idhorno
            WHERE lances.Idlance = $id AND materialvac.CANT > 0
        ");
        return $this->_list();
    }
}

?>
